<template>
  <div class="equipment-defect-correction-style">
    <div class="component-inner-div">
      <!-- 四角样式 -->
      <div class="the-four-border the-four-border-01" />
      <div class="the-four-border the-four-border-02" />
      <div class="the-four-border the-four-border-03" />
      <div class="the-four-border the-four-border-04" />
      <!-- 四角样式 -->

      <!-- 标题栏 -->
      <div class="title">
        <div class="point-icon" />
        <span>设备缺陷整改</span>
      </div>
      <!-- 标题栏 -->

      <div class="content">
        <el-scrollbar>
          <div class="inner-content">
            <div
              v-for="(item, index) in dataList"
              :key="`a${index}`"
              class="content-row">
              <div class="content-left">
                <el-progress :text-inside="true" :class="((index + 1) % 2 !== 0) ? 'progress-single' : 'progress-double'" :stroke-width="14" :percentage="item.value" />
              </div>
              <div class="content-right">
                {{ item.name }}
              </div>
            </div>
          </div>
        </el-scrollbar>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataList: [
        { name: '怀化供电段', value: 0 },
        { name: '长沙供电段', value: 0 },
        { name: '衡阳供电段', value: 0 },
        { name: '广州供电段', value: 0 },
        { name: '肇庆信号水务电段', value: 0 },
        { name: '深圳供电段', value: 0 },
        { name: '惠州供电段', value: 0 },
        { name: '海口综合维修段', value: 0 }
      ]
    }
  },
  mounted() {
    setInterval(() => {
      this.dataList = [
        { name: '怀化供电段', value: 55 },
        { name: '长沙供电段', value: 75 },
        { name: '衡阳供电段', value: 37 },
        { name: '广州供电段', value: 65 },
        { name: '肇庆信号水务电段', value: 65 },
        { name: '深圳供电段', value: 55 },
        { name: '惠州供电段', value: 55 },
        { name: '海口综合维修段', value: 65 }
      ]
    }, 50)
  }
}
</script>

<style lang="scss" scoped>
::v-deep .el-progress-bar__outer{
  background-color: #1b2649;
}

::v-deep .el-scrollbar__wrap{
  overflow-x: hidden;
}

.equipment-defect-correction-style {
  color: white;
  width: 470px;
  box-sizing: border-box;
  overflow: hidden;
  .component-inner-div {
    border: 2px solid #122a57;
    height: 100%;
    background-color: rgba($color: #0b1945, $alpha: 0.48);
    box-sizing: border-box;
    .title {
      font-size: 20px;
      padding: 0;
      margin: 23px 0 20px 0;
      align-items: center;
      display: flex;
      .point-icon {
        background-color: white;
        height: 10px;
        width: 10px;
        margin: 0 10px 0 17px;
      }
    }
    .content {
      position: absolute;
      top: 66px;
      bottom: 0;
      width: 100%;
      padding: 0 16px 0 16px;
      overflow: hidden;
      .el-scrollbar {
        position: absolute;
        top: 0;
        left: 16px;
        right: 5px;
        bottom: 0;
      }
      .inner-content {
        .content-row {
          height: 16px;
          margin-bottom: 16px;
          display: flex;
          .content-left {
            width: 301px;
            .progress-single ::v-deep .el-progress-bar__inner {
              background-image: linear-gradient(to right,  #029fe4, #05ffe1);
            }
            .progress-double ::v-deep .el-progress-bar__inner {
              background-image: linear-gradient(to right,  #eda514, #0dcc9a);
            }
          }
          .content-right {
            text-align: right;
            width: 137px;
          }
        }
      }
    }
  }
}
</style>
